layui.use(['layer','table', 'form', 'laydate', 'element', 'layedit'],function(){
    var layer = parent.layer === undefined ? layui.layer : top.layer,
        $ = layui.jquery,
        table = layui.table,
        laydate = layui.laydate;
        element = layui.element;

    var project_id = $('#id').val();
    console.log(project_id);
    table.render({
        elem: '#projectDetails',
        url : ctx+'/project/detail?id='+project_id,
        cellMinWidth : 95,
        page : false,
        height : "full-125",
        id : "projectDetailsTable",
        cols : [[
            {field: "project_id", title:'项目编号',fixed:"true",minWidth:75, sort:true},
            {field: 'user_id', title: '成员编号', minWidth:80, align:"center", sort:true},
            {field: 'true_name', title: '成员姓名', minWidth:80, align:"center", sort:true},
            {field: 'membership', title: '成员身份', minWidth:80, align:"center", sort:true},
        ]],
        done: function (res, curr, count) {
            res.data.forEach(function (item, index){
                if(item.membership === '项目经理') {
                    $('tbody')
                        .find('tr[data-index="' + index + '"]')
                        .find('td[data-field="membership"]')
                        .css('background-color', '#0ff1f1');
                }
            })
        }
    })
});
